<div class="block_list">
<?php
Yii::app()->clientScript->registerCoreScript('jquery');
$block_add = 1;
foreach ($model as $home) {
	if(!$home->home_show){
		continue;
	}
    $block_add ++;
    if($home) {
        switch ($home->type) {
            case 'project':
                $data = $home;
                if($data!=null && $data->home_show ){
                    $this->renderPartial('/artistProject/_home_view',array('data'=>$data,'block_add'=>$block_add,'home_id'=>$home->id));
                }
                break;
            case 'artist':
                $data = $home;//Artist::model()->findByPk($home->owner);
                if($data!=null && $data->home_show ){
                	$this->renderPartial('/artist/_home_view',array('data'=>$data,'block_add'=>$block_add,'home_id'=>$home->id));
                }
                break;
            case 'blog':
                $data = $home;//Blog::model()->findByPk($home->owner);
                if($data!=null && $data->home_show && $data->recommend){
                    $this->renderPartial('/blog/_home_view',array('data'=>$data,'block_add'=>$block_add,'home_id'=>$home->id));
                }
                break;
            case 'shop':
                $data = $home;//Shop::model()->findByPk($home->owner);
                if($data != null){
                    $this->renderPartial('/shop/_home_view',array('data'=>$data,'block_add'=>$block_add,'home_id'=>$home->id));
                }
                break;
            default :
                //$this->render('/artistProject/_view',array('model'=>$home));
                $block_add --;
                break;
        }
    }
}
?>
    <div class="clear"></div>
</div>
<?php
if(isset($image_new)):
?>
<div class="image_new_more">
    <div class="image_new left">
        <div class="new left">
            <h2><?php echo CHtml::link($image_new->title,Yii::app()->createUrl('/blog/view',array('id'=>$image_new->id))); ?></h2>
            <?php
            if($image_new->discription != null){
                echo '<p>'.Tool::character_limiter(Tool::delete_htm($image_new->discription), 130).'</p>';
                echo '<h3>'.CHtml::link('Read More',Yii::app()->createUrl('/blog/view',array('id'=>$image_new->id))).'</h3>';
            }
            ?>
        </div>
        <div class="image right">
            <?php if($image_new->thumbnail != null) echo CHtml::image($image_new->thumb,$image_new->title); ?>
        </div>
    </div>
    <div class="more right">
        <h2><a href="<?php echo Yii::app()->createUrl('/blog') ?>" id="more_news">More News</a></h2>
        <h2><a href="<?php echo Yii::app()->params['facebook'] ?>">Facebook</a></h2>
        <h2><a href="<?php echo Yii::app()->params['twitter'] ?>">Twitter</a></h2>
    </div>
    <div class="clear"></div>
</div>
<?php
endif;
?>
<?php
if(isset($news)){
    $index = 0;
    echo '<div class="home_news home_bottom_news">';
    foreach ($news as $new) {
        if($index == 0){
            $class_name = 'left';
        }else{
            $class_name = 'right';
        }
        echo '<div class="'.$class_name.'"><h2>'.CHtml::link($new->title,Yii::app()->createUrl('/blog/view',array('id'=>$new->id))).'</h2>';
        echo '<p>'.Tool::character_limiter(Tool::delete_htm($new->discription), 130).'</p>';
        if($new->discription != null){
            echo '<h3>'.CHtml::link('Read More',Yii::app()->createUrl('/blog/view',array('id'=>$new->id))).'</h3>';
        }
        echo '</div>';
        $index ++;
    }
    echo '</div>';
}
?>
<script type="text/javascript">
$(function(){
    $('.view').hover(
        function(){
            //$(this).children('.hover_info').fadeIn("fast");
            $(this).children('.hover_info').show();
        },
        function(){
            //$(this).children('.hover_info').fadeOut("fast");
            $(this).children('.hover_info').hide();
        }
    );
});
</script>